<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: zxa
  Date: 17-7-23
  Time: 下午4:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <style>
        body{
        }
        form{
            border: 2px black solid;
            padding: 50px;
            margin: 50px auto;
            width: 500px;
            height: 700px;
            line-height: 40px;
        }
    </style>
    <script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
    <script>



        function  show() {
            var img1 = $("#imagetext").val();
            $("#imageT").attr("src",img1);
        }
    </script><title>修改添加</title>
</head>
<body>
<form action="addOrUpdate.do" method="POST">
    <c:if test="${empty pro}">
        产品编号：<input type="number" name="id" value="${pro.id}" ><br>

    </c:if>
    <c:if test="${!empty pro}">
        产品编号：<input type="number" disabled value="${pro.id}" ><br>
        <input type="hidden" name="id" value="${pro.id}" />

    </c:if>


    产品名称：<input type="text" name="proName"  value="${pro.proName}" ><br>
    产品描述：<input type="text" name="productDes" value="${pro.productDes}" ><br>
    产品价格：<input type="text" name="price" value="${pro.price}" ><br>
    添加时间：<input type="date" name="create" value="${pro.createTime}" ><br>
    产品图片：<input id="imagetext"  onblur="show()"  type="text" name="image" value="${pro.image}" />
    <br>

        <img id="imageT" width="200" height="200" src="${pro.image}">
    <input style="width:100px;height:40px;margin:10px auto;border:0px;background-color: #ff752f "  type="submit" value="提交" >
</form>

</body>
</html>
